<?php


namespace app\web\admin;


use app\admin\controller\Admin;
use app\common\builder\ZBuilder;
use think\Db;


/**
 * 地区
 */
class Area extends Admin
{


    public function index(){

        $data = Db::name('area')->where($this->getMap())->select();
        return ZBuilder::make('table')
        ->addColumns([
            ['id','ID'],
            ['title','名称'],
            ['pid','上级名','callback',function($val){return getParentTitle($val);}],
        ])
        ->autoAdd()
        ->setRowList($data)
        ->hideCheckbox()
        ->fetch();
    }

}